<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"
    import="paket.*"
    import= "java.util.*"%>
   	<%  
   	MainModel model = (MainModel) session.getAttribute("MainModel");
	if(model==null){
	model = new MainModel();
	session.setAttribute("MainModel", model);
	}
	%>
    <meta http-equiv="REFRESH" content="0;url=index.jsp">
    <% 
    String name = request.getParameter("UserName");
    String pass = request.getParameter("Password");
    name = name.toLowerCase();
    pass = pass.toLowerCase();
    
    if(model.giltigAnvUI(name, pass)==false){
    	session.setAttribute("inloggad","tryAgain");
    }
    else{
    	session.setAttribute("inloggad","true");
    	session.setAttribute("sessionUserName",name);
    	session.setAttribute("sessionUserId",model.getUserIdUI((String) session.getAttribute("sessionUserName")));
    }
    %>
    